<?php
/**
 * @author Matteo Vigoni <mattevigo@gmail.com>
 * @package Crystal Newton
 * @version 1.0
 *
 * Option per l'aggiunta di un nuovo evento
 */
defined("_ENTRY_") or die("Restricted Access!");
defined("_ADMIN_") or header("Location:login.php");	// only admin-entry

import("pages.templates.admin.includes.contents");

$db = getDB();

$option_ore = "";
$option_min = "";

for($i=0; $i<24; $i++)
{
	$is = "";
	if($i < 10) $is .= "0";
	$is .= $i;
	$option_ore .= "<option value=\"$is\">$is</option>";
}
for($i=0; $i<4; $i++)
{
	$a = $i*15;
	$as = $a;
	if($a == 0) $as = "00";
	$option_min .= "<option value=\"$as\">$as</option>";
}
?>

<link type="text/css" rel="stylesheet" href="<?php echo WEB_ROOT."/pages/templates/admin/css/style.add_event.css"; ?>" />

<h4>Add a new show...</h4>
<div id="breadcumbs"><a href="<?php echo WEB_ROOT; ?>"><?php echo SITE_NAME ?></a> &#62; <a
	href="<?php echo WEB_ROOT; ?>/admin.php">admin</a> &#62; <a href="<?php echo WEB_ROOT; ?>admin.php?option=add_event">Add Show</a></div>
	
<?php //if($_SESSION['message'] != null) echo "<div class=\"message\"><b>".get_message()."</b></div>";?>
<?php //if($_SESSION['error'] != null) echo "<div class=\"error\"><b>".get_error()."</b></div>";?>
<?php load_advise(); ?>


<script type="text/javascript" src="<?php echo WEB_ROOT; ?>/pages/templates/admin/js/ppanel.add_event.js"></script>

<div id="recipient-content">
<form
	action="<?php echo WEB_ROOT."/admin.php?script=add_event&content=html";?>"
	method="post">
<fieldset><legend>Add a new Show</legend>
<fieldset><legend>Date</legend>
	<table class="table-event">
		<tr>
			<td>Begin:</td>
			<td><input id="event_start_date" name="event_start_date" class="event_date" type="text" />
			ore <select id="event_start_h" name="event_start_h">
			<?php echo $option_ore; ?>
			</select> : <select id="event_start_min" name="event_start_min">
			<?php echo $option_min; ?>
			</select></td>
		</tr>
		<tr>
			<td>End:</td>
			<td><input id="event_end_date" name="event_end_date" class="event_date" type="text" />
			ore <select id="event_end_h" name="evento_end_h">
			<?php echo $option_ore; ?>
			</select> : <select id="evento_end_min" name="evento_end_min">
			<?php echo $option_min; ?>
			</select></td>
		</tr>
	</table>
</fieldset>
<br />

<fieldset><legend>Details</legend>
		
			<label>Name</label><input name="show_title_ita" type="text"><br />
			<input name="show_title_eng" type="text" style="display: none;">
			<label>Description</label><textarea name="show_description_ita" cols="30" rows="15"></textarea><br />
			<textarea name="show_description_eng" cols="30" rows="15" style="display: none;"></textarea>
</fieldset>
<br />
<fieldset><legend>References</legend>
	<table>
		<tr class="table-event"> <!-- RIGA 4 -->
			<td class="table-event">Link</td>
			<td class="table-event"><input name="show_link" type="text"></td>
		</tr>
		<tr class="table-event"> <!-- RIGA 4 -->
			<td class="table-event">YouTube link</td>
			<td class="table-event"><input name="show_youtube" type="text"></td>
		</tr>
		<tr class="table-event"> <!-- RIGA 4 -->
			<td class="table-event">Googlemaps link</td>
			<td class="table-event"><input name="show_googlemap" type="text"></td>
		</tr>
	</table><br />
</fieldset>
<br />
<button type="submit">Save Show</button>
</fieldset>
</form>

</div>
